<include file="public/header" title="团购" />
<include file="public/header_nav" title="团购" href="javascript:history.back(-1)"/>
<!--倒计时-->
<script>
    var Tday = new Array();
    var daysms = 24 * 60 * 60 * 1000
    var hoursms = 60 * 60 * 1000
    var Secondms = 60 * 1000
    var microsecond = 1000
    var DifferHour = -1
    var DifferMinute = -1
    var DifferSecond = -1
    function clock11(key){
        var time = new Date()
        var hour = time.getHours()
        var minute = time.getMinutes()
        var second = time.getSeconds()
        var timevalue = ""+((hour > 12) ? hour-12:hour)
        timevalue +=((minute < 10) ? ":0":":")+minute
        timevalue +=((second < 10) ? ":0":":")+second
        timevalue +=((hour >12 ) ? " PM":" AM")
        var convertHour = DifferHour
        var convertMinute = DifferMinute
        var convertSecond = DifferSecond
        var Diffms = Tday[key].getTime() - time.getTime()
        DifferHour = Math.floor(Diffms / daysms)
        Diffms -= DifferHour * daysms
        DifferMinute = Math.floor(Diffms / hoursms)
        Diffms -= DifferMinute * hoursms
        DifferSecond = Math.floor(Diffms / Secondms)
        Diffms -= DifferSecond * Secondms
        var dSecs = Math.floor(Diffms / microsecond)

        if(convertHour != DifferHour) e="<span class=hour>"+DifferHour+"</span>天";
        if(convertMinute != DifferMinute) f="<span class=min>"+DifferMinute+"</span>时";
        if(convertSecond != DifferSecond) g="<span class=sec>"+DifferSecond+"</span>分";
        h="<span class=msec>"+dSecs+"</span>秒";
        if (DifferHour>0) {e=e}
        else {e=''}
        document.getElementById("jstimerBox"+key).innerHTML = '剩余<br />'+e + f + g + h;
    }
</script>
		<nav class="storenav grst p">
			<ul>
				<li <if condition="$Request.param.type eq ''">class='red'</if>>
                    <a href="{:U('Mobile/Activity/group_list')}">
                        <span >默认</span>
                    </a>
				</li>
				<li <if condition="$Request.param.type eq 'new'">class='red'</if>>
                    <a href="{:U('Mobile/Activity/group_list',array('type'=>'new'))}">
					    <span >最新</span>
					<i></i>
					</a>
				</li>
				<li <if condition="$Request.param.type eq 'comment'">class='red'</if>>
                    <a href="{:U('Mobile/Activity/group_list',array('type'=>'comment'))}">
                        <span >评论数</span>
					    <i></i>
					</a>
				</li>
			</ul>
		</nav>
		<!--<div class="floor guesslike groupquess">-->
			<!--<div class="likeshop">-->
				<!--<ul>-->
                    <!--&lt;!&ndash;顶部商品列表-s&ndash;&gt;-->
					<!--<li>-->
						<!--<a href="javascript:void(0);">-->
							<!--<div class="similer-product">-->
								<!--<div class="zjj close">-->
									<!--<img src="__STATIC__/images/tg_03.jpg">-->
                                    <!--&lt;!&ndash;活动结束提示图片-s&ndash;&gt;-->
									<!--<img src="__STATIC__/images/close.png" style="position: absolute;z-index: 999;left: 0;top: 0;"/>-->
                                    <!--&lt;!&ndash;活动结束提示图片-e&ndash;&gt;-->
									<!--<div class="sale">-->
										<!--<p>直降</p>-->
										<!--<p>12</p>-->
									<!--</div>-->
								<!--</div>-->
								<!--<span class="similar-product-text">诺贝达灰配枣红间色手提包时尚商务人士首选诺贝达灰配枣红间色手提包时尚商务人士首选诺贝达灰配枣红间色手提包时尚商务人士首选诺贝达灰配枣红间色手提包时尚商务人士首选</span>-->
								<!--<span class="cy"><i>200</i>人参与</span>-->
								<!--<span class="similar-product-price">-->
									<!--¥-->
									<!--<span class="big-price">344</span>-->
									<!--<span class="small-price">.00</span>-->
								<!--</span>-->
							<!--</div>-->
						<!--</a>-->
					<!--</li>-->
                    <!--&lt;!&ndash;顶部商品列表-e&ndash;&gt;-->
				<!--</ul>-->
			<!--</div>-->
		<!--</div>-->

        <!--广告图片-s-->
		<div class="banner">
            <adv pid="204" limt="1" item="v1">
                <a href="{$v.ad_link}">
                    <img src="{$v1[ad_code]}" title="{$v[title]}" style="{$v[style]}"/>
                </a>
            </adv>
		</div>
        <!--中间广告图（2张）-s-->
		<div class="gg2">
			<ul>
                <adv pid="205" limt="1" item="v">
                    <li>
                        <a href="{$v.ad_link}">
                            <img src="{$v[ad_code]}" title="{$v[title]}" style="{$v[style]}"/>
                        </a>
                    </li>
                </adv>
                <adv pid="206" limt="1" item="v">
                    <li>
                        <a href="{$v.ad_link}">
                            <img src="{$v[ad_code]}" title="{$v[title]}" style="{$v[style]}"/>
                        </a>
                    </li>
                </adv>
			</ul>
		</div>
        <!--中间广告图（2张）-e-->

        <!--底部广告图-s-->
		<div class="banner borltrt">
            <adv pid="207" limit="1" item="v">
                <a href="{$v.ad_link}">
                    <img class="bor" src="{$v[ad_code]}" title="{$v[title]}" style="{$v[style]}"/>
                </a>
            </adv>
		</div>
		<div class="th3 p">
			<ul>
                <!--广告小图（3张）-s-->
                <adv limit="3" item="v" pid="208">
                    <li>
                        <a href="{$v.ad_link}">
                            <div class="around">
                                <img src="{$v[ad_code]}" title="{$v[title]}" style="{$v[style]}"/>
                            </div>
                        </a>
                    </li>
                </adv>
                <!--广告小图（3张）-e-->
			</ul>
		</div>
        <!--底部广告图-e-->
        <!--广告图片-e-->

        <!--底部商品列表-s-->
		<div class="floor guesslike groupquess dic">
			<div class="likeshop">
				<ul>
                    <foreach name="list" item="v" key="k" >
					<li>
						<a href="{:U('Mobile/Goods/goodsInfo',array('id'=>$v[goods_id],'item_id'=>$v[item_id]))}">
							<div class="similer-product">
								<div class="zjj close">
									<img src="{$v.goods_id|goods_thum_images=200,200}">
									<div class="sale onsale">
										<p>{$v[rebate]}折</p>
									</div>
								</div>
								<span class="similar-product-text">{$v[goods_name]}</span>
								<span class="cy"><i>{$v[virtual_num] + $v[order_num]}</i>人参与</span>
								<span class="similar-product-price">
									¥
									<span class="big-price">{$v[price]}元</span>
									<!--未打折价格<span class="small-price"  style="display:;">￥{$v[goods_price]}元</span> -->
									<span class="fr sg_g_time last_g_time" id="jstimerBox{$v[goods_id]}"></span>
								</span>
							</div>
						</a>
					</li>
                    <script>
                        Tday['{$v[goods_id]}'] = new Date('{$v.end_time|date="Y/m/d H:i:s",###}');
                        window.setInterval(function() {clock11('{$v[goods_id]}');}, 1000);
                    </script>
                    </foreach>
				</ul>
			</div>
		</div>
        <!--底部商品列表-e-->

        <!--底部导航-start-->
        <include file="public/footer_nav"/>
        <!--底部导航-end-->
<script type="text/javascript" src="__STATIC__/js/sourch_submit.js"></script>
<script type="text/javascript">
    //倒计时
    function goTop(){
        $('html,body').animate({'scrollTop':0},600);
    }

    //加载更多商品
    var page = 1;
    function ajax_sourch_submit(){
        ++page;
        $.ajax({
            type:'GET',
            url:"/index.php?m=Mobile&c=Activity&is_ajax=1&a=group_list&p="+page,
            success:function(data){
                if(data){
                    $(".likeshop>ul").append(data);
                    $('.get_more').hide();
                }else{
                    $('.get_more').hide();
                    $('#getmore').remove();
                }
            }
        })
    }
    //滚动加载更多
    $(window).scroll(
        function() {
            var scrollTop = $(this).scrollTop();
            var scrollHeight = $(document).height();
            var windowHeight = $(this).height();
            if (scrollTop + windowHeight == scrollHeight) {
                ajax_sourch_submit();//调用加载更多
            }
        }
    );
</script>
	</body>
</html>
